self.addEventListener('message', e => {
    let task = e.data;
    console.log('worker接受到任务:', task);
    switch (task.name) {
        case 'task1':
            self.postMessage({ teskName: task.name, teskResult: 1 });
            break
        case 'task2':
            self.postMessage({ teskName: task.name, teskResult: 2 });
            break
    }
});
